import 'package:flutter/material.dart';
import 'package:aweb5/base/BaseWidget.dart';
//import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
//import 'package:flutter_cupertino_date_picker/flutter_cupertino_date_picker.dart';
//import 'package:flutter_date_picker/flutter_date_picker.dart';
//import 'package:flutter_date_picker/flutter_date_picker.dart';
//import 'package:flutter_date_picker/flutter_time_picker.dart';
class Setting extends BaseWidget {
  @override
  State<Setting> createState() => SettingState();
}

class SettingState extends BaseWidgetState<Setting> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: appBarWithBack("设置"),
      body: ListView(
        children: <Widget>[top(), list(context),SizedBox(height: 50,),logout()],
      ),
    );
  }

  Widget top() {
    return Container(
      height: 59,
      padding: EdgeInsets.only(left: 10, right: 20),
      alignment: Alignment.centerLeft,
      color: Color(0xfff5f5f5),
      child: Row(
        children: <Widget>[
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text(
                "同步微信头像、昵称",
                style: TextStyle(color: Color(0xff2d2d2d), fontSize: 13),
              ),
              SizedBox(
                height: 10,
              ),
              Text(
                "方便好友辨认您的身份",
                style: TextStyle(color: Color(0xff888888), fontSize: 11),
              )
            ],
          ),
          Expanded(child: Text("")),
          InkWell(
            child: Container(
              child: Text("同步"),
              decoration: BoxDecoration(
                  border: Border.all(color: Color(0xff626262)),
                  borderRadius: BorderRadius.circular(15)),
              padding: EdgeInsets.only(left: 12, right: 12, top: 5, bottom: 5),
            ),
          ),
        ],
      ),
    );
  }

  Widget list(con) {
    return ListView(
      shrinkWrap: true,
      children: <Widget>[
        Container(
          alignment: Alignment.center,
          padding: EdgeInsets.only(left: 10, right: 10),
          height: 56,
          child: Row(
            children: <Widget>[
              Text(
                "头像",
                style: TextStyle(color: Color(0xff2d2d2d)),
              ),
              Expanded(child: Text("")),
              FadeInImage.assetNetwork(
                placeholder: "assets/touxiang.png",
                image: "",
                width: 34,
                height: 34,
              )
            ],
          ),
        ),
        Image.asset(
          "assets/line.png",
          height: 3,
        ),
        Container(
          height: 37,
          alignment: Alignment.center,
          padding: EdgeInsets.only(left: 10, right: 10),
          child: Row(
            children: <Widget>[
              Text(
                "头像",
                style: TextStyle(color: Color(0xff2d2d2d)),
              ),
              Expanded(child: Text("")),
              Text(
                "星星几颗",
                style: TextStyle(color: Color(0xffadadad)),
              ),
            ],
          ),
        ),
        Image.asset(
          "assets/line.png",
          height: 3,
        ),
        Container(
          height: 37,
          alignment: Alignment.center,
          padding: EdgeInsets.only(left: 10, right: 10),
          child: Row(
            children: <Widget>[
              Text(
                "姓名",
                style: TextStyle(color: Color(0xff2d2d2d)),
              ),
              Expanded(child: Text("")),
              Text(
                "啊啊",
                style: TextStyle(color: Color(0xffadadad)),
              ),
            ],
          ),
        ),
        Image.asset(
          "assets/line.png",
          height: 3,
        ),
        Container(
          height: 37,
          alignment: Alignment.center,
          padding: EdgeInsets.only(left: 10, right: 10),
          child: Row(
            children: <Widget>[
              Text(
                "手机号",
                style: TextStyle(color: Color(0xff2d2d2d)),
              ),
              Expanded(child: Text("")),
              Text(
                "13890987890",
                style: TextStyle(color: Color(0xffadadad)),
              ),
            ],
          ),
        ),
        Image.asset(
          "assets/line.png",
          height: 3,
        ),
        Container(
          height: 37,
          alignment: Alignment.center,
          padding: EdgeInsets.only(left: 10, right: 10),
          child: Row(
            children: <Widget>[
              Text(
                "性别",
                style: TextStyle(color: Color(0xff2d2d2d)),
              ),
              Expanded(child: Text("")),
              Text(
                "女",
                style: TextStyle(color: Color(0xffadadad)),
              ),
              SizedBox(
                width: 5,
              ),
              Image.asset(
                "assets/rightarrow.png",
                width: 8,
                height: 16,
              )
            ],
          ),
        ),
        Image.asset(
          "assets/line.png",
          height: 3,
        ),
        InkWell(
    child: Container(
      height: 37,
      alignment: Alignment.center,
      padding: EdgeInsets.only(left: 10, right: 10),
      child: Row(
        children: <Widget>[
          Text(
            "生日",
            style: TextStyle(color: Color(0xff2d2d2d)),
          ),
          Expanded(child: Text("")),
          Text(
            "1997-08-12",
            style: TextStyle(color: Color(0xffadadad)),
          ),
          SizedBox(
            width: 5,
          ),
          Image.asset(
            "assets/rightarrow.png",
            width: 8,
            height: 16,
          )
        ],
      ),
    ),
          onTap: (){
//            showDate(con);
          },
    )
        ,
        Image.asset(
          "assets/line.png",
          height: 3,
        ),
        Container(
          height: 37,
          alignment: Alignment.center,
          padding: EdgeInsets.only(left: 10, right: 10),
          child: Row(
            children: <Widget>[
              Text(
                "地区",
                style: TextStyle(color: Color(0xff2d2d2d)),
              ),
              Expanded(child: Text("")),
              Text(
                "陕西省-咸阳市-渭城区",
                style: TextStyle(color: Color(0xffadadad)),
              ),
              SizedBox(
                width: 5,
              ),
              Image.asset(
                "assets/rightarrow.png",
                width: 8,
                height: 16,
              )
            ],
          ),
        ),
      ],
    );
  }

  Widget logout(){
         return
           InkWell(child: Container(
             height: 30,
             margin: EdgeInsets.only(left: 60,right: 60),
             decoration: BoxDecoration(color: Color(0xffff89000),borderRadius: BorderRadius.circular(15)),
             alignment: Alignment.center,
             child: Text("退出登录",style: TextStyle(color: Color(0xffffffff),fontSize: 13),),

           ),)
           ;
  }

//  void showDate(con) {
//    DatePicker.showDatePicker(con,
//        showTitleActions: true,
//        minTime: DateTime(2018, 3, 5),
//        maxTime: DateTime(2019, 6, 7), onChanged: (date) {
//          print('change $date');
//        }, onConfirm: (date) {
//          print('confirm $date');
//        }, currentTime: DateTime.now(), locale: LocaleType.zh);
//  }
//    DatePicker.showDatePicker(
//        BuildContext context,
//        DateTime minDateTime,
//        DateTime maxDateTime,
//        DateTime initialDateTime,
//        String dateFormat,
//        DateTimePickerLocale locale: DATETIME_PICKER_LOCALE_DEFAULT,
//        DateTimePickerMode pickerMode: DateTimePickerMode.date,
//        DateTimePickerTheme pickerTheme: DatePickerTheme.Default,
//        DateVoidCallback onCancel,
//        DateVoidCallback onClose,
//        DateValueCallback onChange,
//        DateValueCallback onConfirm,
//    });


//  return DatePicker(
//    key: dobKey,
//    setDate: _setDate,
//    customShape: StadiumBorder(
//        side: BorderSide(
//          color: Color(0xFFF991A0),
//        )),
//  );


}
